<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>样式绑定</title>
    <script type="text/javascript" src="js/vue.js" ></script>
    <style>
    	.actives{
    		color:red;
    	}
    </style>
	</head>
	<body>
		<!--class的对象绑定-->
		<!--:class="{actives : isactives}" 键对值,前面为样式名,后面为样式数据-->
		<div id="app">
			<div 
				@click="handleclick"
				:class="{actives : isactives}"
				<!--	:style="[actives,{fontSize:'20px'}]"-->
				>
				
				hello world</div>
		</div>
		
		<script>
			var app = new Vue({
				el:"#app", 
				data:{
					isactives:false
				},
				methods:{
					handleclick:function(){
						this.isactives = !this.isactives  //后面进行取反,如果为假就为真,为真就为假，也可以用三元运算符编写
					}
				}
			})
		</script>
	</body>
</html>
